var spage, tid;
document.addEventListener('plusready',function(){
	var ws = plus.webview.currentWebview();
	spage = ws.spage;
	tid = ws.tid;
	console.log(spage+" "+tid);
	console.log(apiRoot+"?m=home&c=studio&a=getStudio");
	$.ajax({
		type:"get",
		url:apiRoot+"?m=home&c=studio&a=getStudio&tid="+tid,
		dataType :'json',
		complete :function(){
			plus.nativeUI.closeWaiting();
		},
		success : function(data){
			console.log(JSON.stringify(data)); 
			var list = '';
			$.each(data, function(k,v) {
//				console.log(JSON.stringify(v));
				list += '<div class="mui-input-row mui-radio mui-left mui-table-view-cell rz-list">'+
							'<input name="checkbox" onclick="subcheck(\''+v.id+'\',\''+v.title+'\')" type="radio" >'+
							'<label>'+
								'<li>'+v.title+'</li>'+
								'<li class="mui-h5">'+v.introduce+'</li>'+
							'</label>'+
						'</div>';
			});
			$('.studioList').html(list);
		},
		error : function (e){
			console.log(JSON.stringify(e));
			errortoast();
		}
	});
	
	
},false)
function subcheck(id,title){
	console.log(id+" "+title);
	var parentid = plus.webview.getWebviewById(spage);
	mui.fire(parentid,'change',{studioid:id, studioname:title});
	//当前页关闭
	mui.back();
}
